package LuoGu.二分查找.查找;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.StreamTokenizer;

public class Main {
    public static void main(String[] args) throws IOException {
        StreamTokenizer st = new StreamTokenizer(new BufferedReader(new InputStreamReader(System.in)));
        st.nextToken();
        int n = (int) st.nval;
        st.nextToken();
        int nn = (int) st.nval;
        int [] temp = new int [n];
        for(int i=0;i<n;i++){
            st.nextToken();
            temp[i] = (int) st.nval;
        }
        for(int i=0;i<nn;i++){
            st.nextToken();
            int tempn = (int) st.nval;
            int l = 0, r = n-1, m = (r-l)/2+l;
            while(l<r){
                if(temp[m]>=tempn) r=m;
                else l = m+1;
                m = (r-l)/2+l;
            }
            if(temp[l]==tempn) System.out.print((l+1)+" ");
            else System.out.print(-1+" ");
        }
    }
}
